from pyftpdlib import servers
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.authorizers import DummyAuthorizer

# 创建一个虚拟用户
authorizer = DummyAuthorizer()
#用户名,密码,分享的文件夹
authorizer.add_user("321", "123", "E:\\XL\\project\\Python\\sockers\\", perm="elradfmw")

# 创建FTP处理程序
handler = FTPHandler
handler.authorizer = authorizer

# 创建FTP服务器实例
server = servers.FTPServer(("192.168.231.16", 21), handler)

# 启动服务器
server.serve_forever()